home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / airfox.swf / scripts / frame_8 / PlaceObject2_340_157 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2006-06-13  |  1.2 KB  |  54 lines

  1. onClipEvent(enterFrame){
  2.    if(_name != "traincar")
  3.    {
  4.       _Y = _Y + _root.scrollspeed;
  5.       if(320 < _Y)
  6.       {
  7.          removeMovieClip(this);
  8.       }
  9.       if(direction == 0)
  10.       {
  11.          _X++;
  12.          if(340 < _X)
  13.          {
  14.             removeMovieClip(this);
  15.          }
  16.       }
  17.       if(direction == 1)
  18.       {
  19.          _X--;
  20.          if(_X < -40)
  21.          {
  22.             removeMovieClip(this);
  23.          }
  24.       }
  25.       if(320 < _Y)
  26.       {
  27.          removeMovieClip(this);
  28.       }
  29.       i = 2000;
  30.       while(2010 >= i)
  31.       {
  32.          if(this.hitTest("_root." + i))
  33.          {
  34.             killthis = 1;
  35.          }
  36.          i++;
  37.       }
  38.       if(killthis == 1)
  39.       {
  40.          removeMovieClip("_root." + i);
  41.          _root.explosioncount = _root.explosioncount + 1;
  42.          duplicateMovieClip(_root.explosion,"explosion" + _root.explosioncount,16384 + _root.explosioncount);
  43.          setProperty("_root.explosion" + _root.explosioncount, _X, _X);
  44.          setProperty("_root.explosion" + _root.explosioncount, _Y, _Y);
  45.          if(_root.explosioncount >= 4070)
  46.          {
  47.             _root.explosioncount = 4050;
  48.          }
  49.          _root.score += 50;
  50.          removeMovieClip(this);
  51.       }
  52.    }
  53. }
  54.